// 车辆列表
const vehicleManage = {
  localize: {
    search: {
      url: "http://localhost:8080/customer/vehicle/search"
    },
    preset: {
      status: 1,
      userId: 2
    }
  },
  filters: [
    {
      name: "plateNo",
      label: "车牌号"
    }
  ],
  columns: [
    {
      width: "50",
      label: "#",
      type: "index"
    },
    {
      label: "车牌号",
      name: "plateNo"
    },
    {
      label: "车型",
      name: "type"
    },
    {
      label: "车长(米)",
      name: "length"
    },
    {
      label: "载重(吨)",
      name: "loadWeight"
    },
    {
      label: "容积(立方米)",
      name: "volume"
    },
    {
      label: "购入日期",
      name: "buyDate"
    },
    {
      label: "保险日期",
      name: "insuranceEndDate"
    },
    {
      label: "车辆品牌",
      name: "brand"
    },
    {
      label: "创建日期",
      name: "createAt"
    },
    {
      label: "操作",
      name: "action"
    }
  ],
  actions: [
    {
      title: "新增",
      type: "add",
      target: {
        resourceId: "23"
      }
    },
    {
      title: "导入",
      type: "import",
      target: {
        resourceId: "23"
      }
    }
  ]
};
// 车辆新增
const addVehicle = {
  title: "车辆新增",
  entries: [
    { name: "plateNo", label: "车牌号" },
    { name: "type", label: "车型" },
    { name: "length", label: "规格/车长(米)" },
    { name: "volume", label: "容积(立方米)" },
    { name: "loadWeight", label: "载重(吨)" },
    { name: "seats", label: "座位数/个" },
    { name: "buyDate", label: "购入时间", type: "date" },
    { name: "insuranceEndDate", label: "保险到期时间", type: "date" },
    { name: "brand", label: "车辆品牌" },
    { name: "imageUrl", label: "车辆图片", type: "upload" }
  ],
  actions: [
    {
      title: "保存",
      type: "submit",
      url: "http://localhost:8080/customer/vehicle"
    },
    { disabled: false, title: "重置", type: "reset" }
  ],
  localize: {
    preset: {
      userId: 1,
      type: 0
    }
  },
  rules: {
    plateNo: [{ required: true, message: "车牌号不能为空", trigger: "blur" }],
    buyDate: [{ required: true, message: "购入时间不能为空", trigger: "blur" }],
    insuranceEndDate: [
      { required: true, message: "保险到期时间不能为空", trigger: "blur" }
    ],
    brand: [{ required: true, message: "车辆品牌不能为空", trigger: "blur" }]
  }
};
//   司机列表
const driverManage = {
  localize: {
    search: {
      url: "http://localhost:8080/customer/driver/search"
    },
    preset: {
      status: 1,
      userId: 2
    }
  },
  filters: [
    {
      name: "name",
      label: "姓名"
    }
  ],
  columns: [
    {
      width: "50",
      label: "#",
      type: "index"
    },
    {
      label: "姓名",
      name: "name"
    },
    {
      label: "性别",
      name: "gender",
      type: "radio"
    },
    {
      label: "照片",
      name: "faceIcon",
      type: "upload"
    },
    {
      label: "出生日期",
      name: "birthday"
    },
    {
      label: "联系电话",
      name: "mobile"
    },
    {
      label: "驾照日期",
      name: "driverLicenseDate"
    },
    {
      label: "驾照类型",
      name: "driverLicenseType"
    },
    {
      label: "驾驶证号",
      name: "driverLicenseNo"
    },
    {
      label: "创建日期",
      name: "createAt"
    },
    {
      label: "是否失效",
      name: "statusName"
    },
    {
      label: "操作",
      name: "action"
    }
  ],
  actions: [
    {
      title: "新增",
      type: "add",
      target: {
        resourceId: "23"
      }
    },
    {
      title: "导入",
      type: "import",
      target: {
        resourceId: "23"
      }
    }
  ]
};
// 司机新增
const addDriver = {
  title: "车辆新增",
  entries: [
    { name: "name", label: "姓名" },
    { name: "gender", label: "性别" },
    { name: "birthday", label: "出生日期" },
    { name: "mobile", label: "联系电话" },
    { name: "driverLicenseDate", label: "驾照日期" },
    { name: "driverLicenseType", label: "驾照类型", type: "select" },
    { name: "driverLicenseNo", label: "驾照证号" },
    { name: "faceIcon", label: "司机照片" }
  ],
  actions: [
    {
      title: "保存",
      type: "submit",
      url: "http://localhost:8080/customer/driver"
    },
    { disabled: false, title: "重置", type: "reset" }
  ],
  localize: {
    preset: {
      userId: 1,
      type: 0
    }
  },
  rules: {
    name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
    mobile: [
      { required: true, message: "联系电话不能为空", trigger: "blur" },
      {
        pattern: /^.{11,13}$/,
        message: "手机号或电话必须是11到13位数字",
        trigger: "change"
      }
    ],
    driverLicenseDate: [
      { required: true, message: "驾照日期不能为空", trigger: "blur" }
    ],
    driverLicenseType: [
      { required: true, message: "驾照类型不能为空", trigger: "blur" }
    ],
    driverLicenseNo: [
      { required: true, message: "驾照证号不能为空", trigger: "blur" }
    ]
  }
};
//   收货方信息列表
const receivingInfoList = {
  localize: {
    search: {
      url: "http://localhost:8080/customer/customer/consignee/search"
    },
    preset: {
      status: 1,
      userId: 2
    }
  },
  filters: [
    {
      name: "consigneeName",
      label: "收货方名称"
    },
    {
      name: "customerName",
      label: "客户名称"
    },
    {
      name: "contactName",
      label: "收货方联系人"
    },
    {
      name: "consigneeStatus",
      label: "状态"
    }
  ],
  columns: [
    {
      width: "50",
      label: "#",
      type: "index"
    },
    {
      label: "收货方名称",
      name: "consigneeName"
    },
    {
      label: "客户名称",
      name: "consigneeName"
    },
    {
      label: "收货方联系人",
      name: "contactName"
    },
    {
      label: "收货方联系电话",
      name: "contactMobile"
    },
    {
      label: "创建时间",
      name: "createAt"
    },
    {
      label: "状态",
      name: "statusName"
    },
    {
      label: "操作",
      name: "action"
    }
  ],
  actions: [
    {
      title: "新增",
      type: "add",
      target: {
        resourceId: "23"
      }
    },
    {
      title: "导入",
      type: "import",
      target: {
        resourceId: "23"
      }
    }
  ]
};
// 收货方信息新增
const addReceivingInfo = {
  title: "收货方新增",
  entries: [
    {
      label: "收货方名称",
      name: "consigneeName"
    },
    {
      label: "客户名称",
      name: "customerId",
      type: "dictionary"
    },
    {
      label: "所属行业",
      name: "industry"
    },
    {
      label: "公司网站",
      name: "url"
    },
    {
      label: "公司简称",
      name: "abbr"
    },
    {
      label: "公司英文名",
      name: "englishName"
    },
    {
      label: "企业法人",
      name: "legalPersonName"
    },
    {
      label: "联系人",
      name: "contactName"
    },
    {
      label: "联系电话",
      name: "contactMobile"
    },

    {
      label: "传真",
      name: "fax"
    },
    {
      label: "邮箱",
      name: "email"
    },
    {
      label: "地址",
      name: "address"
    },
    {
      label: "邮编",
      name: "zipcode"
    },
    {
      label: "微信公众号",
      name: "wechatOfficialNo"
    },
    {
      label: "公司开户行",
      name: "bankName"
    },
    {
      label: "银行账号",
      name: "bankAccount"
    },
    {
      label: "公司简介",
      name: "profile"
    },
    {
      label: "公司logo",
      name: "logo",
      type: "upload"
    },
    {
      label: "营业执照",
      name: "businessLicenseUrl",
      type: "upload"
    }
  ],
  actions: [
    {
      title: "保存",
      type: "submit",
      url: "http://localhost:8080/customer/consignee"
    },
    { disabled: false, title: "重置", type: "reset" }
  ],
  localize: {
    preset: {
      userId: 1,
      type: 0
    }
  },
  rules: {
    customerId: [
      { required: true, message: "收货方不能为空", trigger: "blur" }
    ],
    consigneeName: [
      { required: true, message: "收货方不能为空", trigger: "blur" },
      { min: 1, max: 80, message: "长度在 1 到 80 个字符" }
    ],
    contactMobile: [
      { required: true, message: "收货方不能为空", trigger: "blur" },
      { min: 1, max: 50, message: "长度在 1 到 50 个字符" }
    ],
    contactName: [
      { required: true, message: "收货方不能为空", trigger: "blur" },
      { min: 1, max: 20, message: "长度在 1 到 20 个字符" }
    ],
    url: [{ min: 0, max: 80, message: "最多可输入80个字符" }],
    abbr: [{ min: 0, max: 80, message: "最多可输入80个字符" }],
    englishName: [{ min: 0, max: 80, message: "最多可输入80个字符" }],
    englishAbbr: [{ min: 0, max: 50, message: "最多可输入50个字符" }],
    legalPersonName: [{ min: 0, max: 20, message: "最多可输入20个字符" }],
    fax: [{ min: 0, max: 30, message: "最多可输入30个字符" }],
    email: [{ min: 0, max: 30, message: "最多可输入30个字符" }],
    address: [{ min: 0, max: 100, message: "最多可输入100个字符" }],
    zipcode: [{ min: 0, max: 6, message: "最多可输入6个字符" }],
    wechatOfficialNo: [{ min: 0, max: 30, message: "最多可输入30个字符" }],
    bankName: [{ min: 0, max: 80, message: "最多可输入80个字符" }],
    bankAccount: [{ min: 0, max: 30, message: "最多可输入30个字符" }],
    profile: [{ min: 0, max: 100, message: "最多可输入100个字符" }]
  }
};

//   收货地址列表
const receivingAddressList = {
  localize: {
    search: {
      url: "http://localhost:8080/customer/address/search"
    },
    preset: {
      status: 1,
      userId: 2
    }
  },
  filters: [
    {
      name: "consigneeName",
      label: "收货方名称"
    },
    {
      name: "customerName",
      label: "客户名称"
    },
    {
      name: "contactName",
      label: "收货方联系人"
    },
    {
      name: "consigneeStatus",
      label: "状态"
    }
  ],
  columns: [
    {
      width: "50",
      label: "#",
      type: "index"
    },
    {
      label: "收货方名称",
      name: "consigneeName"
    },
    {
      label: "客户名称",
      name: "consigneeName"
    },
    {
      label: "收货方联系人",
      name: "contactName"
    },
    {
      label: "收货方联系电话",
      name: "contactMobile"
    },
    {
      label: "创建时间",
      name: "createAt"
    },
    {
      label: "状态",
      name: "statusName"
    },
    {
      label: "操作",
      name: "action"
    }
  ],
  actions: [
    {
      title: "新增",
      type: "add",
      target: {
        resourceId: "23"
      }
    },
    {
      title: "导入",
      type: "import",
      target: {
        resourceId: "23"
      }
    }
  ]
};
// 收货地址新增
const addReceivingAddress = {
  title: "收货地址新增",
  entries: [
    {
      label: "收货方名称",
      name: "consigneeName"
    },
    {
      label: "客户名称",
      name: "customerId",
      type: "dictionary"
    },
    {
      label: "联系人",
      name: "contactName"
    },
    {
      label: "联系电话",
      name: "contactMobile"
    },
    {
      label: "地址",
      name: "address",
      type: "area"
    },
    {
      label: "详细地址",
      name: "address"
    },
    {
      label: "地址编号",
      name: "addressCode"
    }
  ],
  actions: [
    {
      title: "保存",
      type: "submit",
      url: "http://localhost:8080/customer/address/receiving"
    },
    { disabled: false, title: "重置", type: "reset" }
  ],
  localize: {
    preset: {
      userId: 1,
      type: 0
    }
  },
  rules: {
    consigneeName: [{ required: true, message: "不能为空", trigger: "blur" }],
    customerName: [{ required: true, message: "不能为空", trigger: "blur" }],
    contactMobile: [
      { required: true, message: "不能为空", trigger: "blur" },
      { min: 1, max: 50, message: "长度在 1 到 50 个字符" }
    ],
    contactName: [
      { required: true, message: "不能为空", trigger: "blur" },
      { min: 1, max: 20, message: "长度在 1 到 20 个字符" }
    ],
    districtCode: [
      { required: true, message: "不能为空", trigger: "blur" },
      { validator: districtValidate, trigger: "change" }
    ],
    address: [
      { required: true, message: "不能为空", trigger: "blur" },
      { min: 1, max: 100, message: "长度在 1 到 100 个字符" }
    ]
  }
};
export {
  addVehicle,
  driverManage,
  addDriver,
  vehicleManage,
  receivingInfoList,
  addReceivingInfo,
  addReceivingAddress,
  receivingAddressList
};
class ViewData {
  constructor({ dirs, actions, entries }) {
    this.dirs = dirs;
    this.actions = actions;
    this.entries = entries;
  }
}

export { ViewData };
